import re
import pandas as pd
import shutil
import os


# 批量复制文件夹到指定文件夹下
def copyDirs2Dir(srcDirsPath:list, dstDir:str):
    """
    :param srcDirsPath: 文件夹路径列表
    :param dstDir: 目标文件夹
    :return: None
    """
    for path in srcDirsPath:
        dirname = os.path.basename(path)
        dstpath = os.path.join(dstDir, dirname)
        print(f"copy \'{path}\' to \'{dstpath}\'")
        shutil.copytree(path, dstpath)


# 复制多个文件到指定文件夹下
def copyFiles2Dir(srcPaths:list, dstDir:str):
    """
    filePaths: 文件路径列表
    dstDir：目标文件夹
    """
    for srcPath in srcPaths:
        if not os.path.exists(dstDir):
            os.makedirs(dstDir)
        dstPath=os.path.join(dstDir, os.path.basename(srcPath))
        print(f"copy {srcPath} to {dstPath}")
        shutil.copy2(srcPath, dstPath)

def matchF(regular, s):
    # 使用正则表达式匹配编号
    match = re.search(regular, s)
    return match

if __name__=='__main__':
    srcDirPath=[
        "D:/Data/FWL/GFLab/workspace/project4/FunImgARWSDCF/010HOUGUANGHE",
        "D:/Data/FWL/GFLab/workspace/project4/FunImgARWSDCF/029wanghongzhen"
    ]
    dstDir="E:/hello"
    copyDirs2Dir(srcDirPath, dstDir)
